﻿<?php 
	include "admin/lib/config.inc.php";
	
?>
<div class="container">
	<div id="welcomeLine" class="row">
	
		<?php session_start();
		if(isset($_SESSION['usuario_login'])){
			$usuario_login = $_SESSION['usuario_login'];
		?>
		<div class="span6">Bem Vindo!<strong> <?php echo $usuario_login[3]; ?></strong>
		<?php
				echo "<br><a style='color: #009ACD' href='index.php?pg=minha-pagina'>Minha Página</a>";	
			?>
		</div>
		<div class="span6" >
			
		</div>
		<?php }?>
	</div>
	
<!-- Navbar ================================================== -->
	<div id="logoArea" class="navbar">
	<a id="smallScreen" data-target="#topMenu" data-toggle="collapse" class="btn btn-navbar">
		<span class="icon-bar"></span>
		<span class="icon-bar"></span>
		<span class="icon-bar"></span>
	</a>
	  <div class="navbar-inner">
			<form class="form-inline navbar-search" method="post" action="pesquisa.php" >
			<input id="srchFld" class="srchTxt" type="text" />
			  <select class="srchTxt">
					<option selected>Selecione a Categoria</option>
					<?php
					$rs = mysql_query("SELECT * FROM `categorias` WHERE 1 ORDER BY `nome_categoria`");
					while($row = mysql_fetch_array($rs)){
						$categoria_id= $row['id_categoria'];
						$nome = $row['nome_categoria'];
	
					?>
					<option value="<?php echo $categoria_id; ?>"><?php echo $nome; ?> </option>
					<?php 
					}	
				?>
			</select> 
			  <button type="submit" id="submitButton" class="btn btn-primary">Ir</button>
	    </form>
	    <ul id="topMenu" class="nav pull-right">
	    <a class="brand" href="index.php"><img style="height: 47px;" src="img/logoPequeno.png" alt="Aquitem"/></a>
	    
	    
		 <li class=""><a href="index.php?pg=guia">Guia</a></li>
		 <li class=""><a href="index.php?pg=eventos">Eventos</a></li>
		 <li class=""><a href="index.php?pg=classificados">Classificados</a></li>
		 <li class="">
		 <?php 
		 	if(!isset($_SESSION['usuario_login'])){?>
		 		<a href="#login" role="button" data-toggle="modal" style="padding-right:0"><span class="btn btn-large btn-success">Login</span></a>
		 <?php }
		 else{ ?>
		 	<a href="index.php?pg=logout" style="padding-right:0"><span class="btn btn-danger">Sair</span></a>
		<?php }
		 ?>
		 
		<div id="login" class="modal hide fade in" tabindex="-1" role="dialog" aria-labelledby="login" aria-hidden="false" >
			  <div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h3>Login Block</h3>
			  </div>
			  <div class="modal-body">
				<form class="form-horizontal loginFrm" action="validaLogin.php" method="post">
				  <div class="control-group">								
					<input type="text" id="usr" placeholder="Email" name="usr">
				  </div>
				  <div class="control-group">
					<input type="password" id="pass" placeholder="Password" name="pass">
				  </div>
				  <div class="control-group">
					<label class="checkbox">
					<input type="checkbox"> Remember me
					</label>
				  </div>
				  <button type="submit" class="btn btn-success">Sign in</button>
				</form>		
				
				<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
			  </div>
		</div>
		</li>
	    </ul>
	  </div>
	</div>
</div>
